<template>
  <div>
    <!-- 处方编号 -->
    <section class="c_bh1">
      <div>
        <span>NO.
          {{prescribeInfo.ORDERCODE}}
        </span>
      </div>
    </section>

    <!-- 医院信息 -->
    <section class="c_nav_hospitalname1">
      <div>
        <div>
          <span>{{hospitalName}}</span>
        </div>
        <div>
          <span>西药</span>
          <span>处方笺</span>
        </div>
      </div>
      <!-- <div class="c_nav"> -->
      <!-- <div><span @click="changeShowType='zhongyao'" :class="{c_nav_active: changeShowType =='zhongyao'}">中药</span></div> -->
      <!-- <div><span @click="changeShowType='xiyao'" :class="{c_nav_active: changeShowType =='xiyao'}">西药</span></div> -->
      <!-- </div> -->
    </section>

    <!-- 患者信息 -->
    <section class="c_patient_info1">
      <div>
        <!-- <div>
          <span>医疗证/医保卡号：<b>{{prescribeInfo.PATIENT_HEALTHCARD}}</b></span>
          <span><b>【{{prescribeInfo.PATIENT_HEALTHCARD==''?'自费':'医保'}}】</b></span>
        </div>-->
        <div>
          <span>姓名：<b>{{prescribeInfo.PATIENTNAME}}</b></span>
          <span>性别:<b>{{prescribeInfo.ACCSEX}}</b></span>
          <span>年龄:<b>{{prescribeInfo.PATNL}}</b></span>

        </div>

        <div>
          <span>科室：<b>{{prescribeInfo.SSKBMC}}</b></span>
          <span>日期:<b>{{prescribeInfo.OPENTIME}}</b></span>
        </div>
        <div>诊断：{{this.prescribeInfo.DIAGNOSIS_DETAIL}}</div>
      </div>
    </section>

    <!-- 开药选项 -->
    <section v-show="true" class="zhongyao1">
      <section class="zhongyao_con1">
        <div class="zhongyao_c_title1">
          <p>Rp：{{'('+ybgg+')'}}</p>
        </div>
      </section>
    </section>

    <!-- 中药处方预览页 -->
    <div name="tipMove">
      <div class="medicList1" v-show="true"> <!-- showzhongyao -->
        <div class="medic_o1">
          <span class="medic_l1">
            <ul>
              <li v-for="(item,index) in dragList1" :key="item.id" style="width: 90%;"><span>{{index+1}}</span><span>{{item.split('#')[2]}}</span><span>{{(item.split('#')[4])}}元</span><span>{{item.split('#')[5]}}{{item.split('#')[6]}}</span></li>
            </ul>

          </span>
          <p class="medic_p1">总共{{ dragList1.length }} 味药</p>


          <p class="medic_p1">医嘱：{{this.prescribeInfo.ADVICE||'无'}}</p>
        </div>
        <div class="medic_c1">
          <div>
            <span>
              医师：<b>{{doctorname}}</b>
            </span>
            <span>
              处方总金额（元）：<b>{{this.prescribeInfo.JE}}</b>
            </span>
          </div>

        </div>
        <div class="medic_t1">
          <!--           <p><input type="button" value="开药方" class="input_search" @click="doPrescribe"></p> -->
          <el-button type="info" @click="closePreDetails" style="width:30%">关    闭</el-button>
          <el-button type="primary" @click="goOpenPrescribe" style="width:30%">修改处方</el-button>
          <!-- <span><input type="button" value="返      回" class="input_search1_1" @click="closePreDetails"></span>
          <span><input type="button" value="修改处方" class="input_search2_1" @click="goOpenPrescribe"></span> -->
        </div>
      </div>
    </div>


  </div>
</template>
<script>
const { config } = window;

export default {
  data() {
    return {
      restaurants: [],
      state1: '',
      restaurants2: [],
      state2: '',
      fujia_list: [], // 附加服务，名称和费用
      fujia_options: [{ label: '快递费(12元／每次)', value: 12, disabled: true }],
      numb_zy: '5',
      popupVisible1: false, // 显示中药设置
      popupVisible3: false,
      // buttStyle: 'default', // 输入前：default, 输入后：primary
      ybgg: '药品规格为饮片',
      ybNum: '46546546466546',
      blNum: 'XXXX321321S3S3S213S',
      riqi: '2019',
      doctorname: '1111',
      hospitalName: sessionStorage.getItem('hosName'),
      prescribeNum: '-',

      list: [

      ],
      list2: [],
      name: this.$route.query.name || '张三',
      info: this.$route.query.info || '男  20  天津',
      id: this.$route.query.id,
      isshowkeyboard: true,
      showzhongyao: false,
      showxiyao: false,
      isshowinput: false,
      ts: this.newStore(),
      durgExplain: '',
      changeShowType: 'zhongyao',
      durgSl: this.$route.query.dragSl || '1',
      dragKey: '',
      showList: false,
      ifDuplicate: false,
      alertText: '您的操作可能有问题',
      showAlert: false,
      dragList1: [

      ],
      dragList2: [],
    };
  },
  props: {
    prescribeInfo: {
      type: Object,
    },
  },

  components: {
  },
  watch: {
    prescribeInfo(val, oldVal) {
      this.dragList1 = val.DURGLIST.split(',');
      // this.fujia_list = JSON.parse(val.PRESCRIBEEXPLAIN);
      this.prescribeNum = val.ORDERCODE;
      this.riqi = val.OPENTIME;
      this.doctorname = this.userinfo.docname;
      console.log(oldVal);
    },
  },
  created() {
    this.$root.showfooter = false;
    this.userinfo = JSON.parse(localStorage.getItem(`userInfo.${config.LT}`));
    // this.getlist();

    // 初始化处方号
    // this.prescribeNum = ?
    this.userinfo = JSON.parse(localStorage.getItem(`userInfo.${config.LT}`));
    this.hospitalName = this.userinfo.hospital;
  },
  destroyed() {
    this.$root.showfooter = true;
  },

  methods: {
    /* 继续开处方 */
    /* 返回 */
    /* 获取处方信息 */
    closePreDetails() {
      this.$emit('closePreDetails');
    },
    goOpenPrescribe() {
      this.$emit('goOpenPrescribe', this.prescribeInfo);
    },
    closeTip() {
      this.showAlert = false;
    },
  },
};
</script>
<style>
* {
  margin: 0;
  padding: 0;
}
.mint-cell-wrapper {    /* 隐藏服务项目下边线 */
  background-image: none;
}
.mint-cell:last-child{  /* 隐藏医嘱下边线 */
  background-image: none;
}
.input_search1_1 {
  display: inline-block;
  line-height: 1;
  cursor: pointer;
  background: #ccc;
  border: 1px solid #dcdfe6;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  font-weight: 500;
  padding: 0.6rem 2rem;
  border-radius: 4px;
  width: 75%;
  margin-top: 0.1rem;
  margin-right: 5%;
}
.input_search2_1 {
  display: inline-block;
  line-height: 1;
  cursor: pointer;
  background: #3190e8;
  border: 1px solid #dcdfe6;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  font-weight: 500;
  padding: 0.6rem 2rem;
  border-radius: 4px;
  width: 75%;
  margin-top: 0.1rem;
  margin-right: 5%;
}
.input_search11 {
  display: inline-block;
  line-height: 1;
  cursor: pointer;
  background: #ccc;
  border: 1px solid #dcdfe6;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  font-weight: 500;
  padding: 0.6rem 2rem;
  border-radius: 4px;
  width: 40%;
  margin-top: 0.1rem;
  margin-right: 5%;
}
.input_search21 {
  display: inline-block;
  line-height: 1;
  cursor: pointer;
  background: #3190e8;
  border: 1px solid #dcdfe6;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  font-weight: 500;
  padding: 0.6rem 2rem;
  border-radius: 4px;
  width: 40%;
  margin-top: 0.1rem;
  margin-right: 5%;
}
.select_c1 {
  width: 65%;
  padding: 2%;
  font-size: 0.8rem;
  outline: none;
  border-radius: 0.2rem;
  /* appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none; */
}
.select_c option1 {
  line-height: 20px;
  border: 0;
  padding: 1rem;
}
.select_c option1:hover {
  background: #ebccd1;
}
.step21 {
  margin-top: 5%;
  border-radius: 0.2rem;
  height: 70%;
  width: 90%;
  /* margin-bottom: 76%; */
}
.zhongyao1{
  border-top: .5px dashed #ccc;
  margin-top: .5rem;
}
label{
  margin-bottom: 0;
}
.c_patient_info1 {
  display: flex;
  justify-content: center;
  font-size: .8rem;
  letter-spacing: .05rem;
  background-color: #fff;
  padding: 0 .5rem;
  height: 3rem;
  color:#999;
}
.c_patient_info1 b {
  font-weight: normal;
  color: #000;
}
.c_patient_info1 div {
  width: 100%;
}
.c_patient_info1 div div{
  display: flex;
  flex-flow: row | nowrap;
  justify-content: space-between;
  width:100%;
}
.c_bh1 {
  color: #666;
  padding: .3rem;
}
.c_bh1 div span:first-child{
  z-index: 888;
  line-height: 1rem;
  vertical-align: middle;
}
.medicList1{
  position: absolute;
  top: 24%;
  left: 0;
  width: 100%;
  max-height: 67%; /* 带好盖住后面的内容 */
  z-index: 888;
  overflow: auto;
  background: #fff;
  /* padding:.5rem; */
  font-size: .9rem;
  color: #333;
}
.medicList1 ul li{
  line-height: 2rem;
  padding-left: 1rem;
  display: inline-flex;
}
.cckb1{
  text-align: center;
  color: #ccc;
}
.medic_o1{
  height: 80%;
  overflow: auto;
  padding: .5rem;
}
.medic_o1 p:first-child {
  text-align: center;
}
.medic_t1{
  position: fixed;
  bottom: 0;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  padding: .5rem;
}
.medic_t1 span{
  display: flex;
  justify-content: center;
  flex-direction: row;
  justify-content: center;
  width: 100%;
}
.medic_c1{
  height: 10%;
  border-top: 1px dashed #ccc;
  /* border-bottom: 1px solid #fff; */
  padding: .5rem;
}
.medic_c1 div{
  display: flex;
  line-height: normal;
  flex-flow: row | nowrap;
  justify-content: space-between;
  align-items: stretch;
}
.medic_c1 div span{
  color: #999;
}
.medic_c1 div span b{
  color: #333;
}
.mint-checkbox-label{
  font-size: 0.9rem
}
.s_input1{
  width: 90%;
  height: 12rem;
  background: #f1f1f1;
  position: absolute;
  top: -400%;
  margin: 0 5%;
}
.s_input1 .s_text1{
  border: none;
  width: 80%;
  font-family: "Microsoft Yahei";
  color: #333;
  outline: none;
  text-indent: 1rem;
  line-height: 2rem;
  margin-top: 10%;
  cursor: pointer;
}
.c_nav_hospitalname1 {
  letter-spacing: .05rem;
  display: flex;
  justify-content: center;
  background-color: #fff;
  padding: 0rem;
  height: 3rem;
  color:#333;
}
.c_nav_hospitalname1 div div {
  display: flex;
  flex-flow: column | nowrap;
  justify-content: center;
  align-items: center;
}
.c_nav_hospitalname1 div div:last-child {
  font-size: .9rem;
  display: inline-block;
}
.c_nav_hospitalname1 div div:last-child span{
  padding: 0 .3rem 0 .3rem;
}
.c_nav1 {
  display: flex;
  justify-content: space-around;
  background-color: #fff;
  padding: 1rem;
  border-bottom: 1px solid #ebebeb;
  position: relative;
  height: 3rem;
}
.c_nav_active1 {
  color: #3190e8;
  border-bottom: 2px solid #3190e8;
}
@keyframes tipMove {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(0.8);
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}
.fade-choose-enter-active,
.fade-choose-leave-active {
  transition: opacity 0.2s;
}
.fade-choose-leave,
.fade-choose-leave-active {
  display: none;
}
.fade-choose-enter,
.fade-choose-leave-active {
  opacity: 0;
}
.zhongyao_c_title1 p {
  font-family: "Microsoft Yahei";
  color: #666;
  margin-bottom: 0;
  padding: 0.4rem;
  font-size: .9rem;
}
.zhongyao_c_content1 {
  max-height: 22rem;
  overflow: auto;
  padding: 0.5rem;
  position: relative;
  font-size: .9rem;
  color: #333;
}
.zhongyao_c_content1 .m-slide .m-slide__del-red{
  background: #3190e8;
  border-radius: 0.2rem;
  width: 4rem;
  height: 1.4rem;
  border: none;
  margin-top: 0.1rem;
}
.zhongyao_c_content1 .m-slide .m-slide__top{
  height: 1.8rem;
}
.zhongyao_c_content1 ul li {
  list-style: none;
  font-size: 0.9rem;
  height: 2.5rem;
  width: 100%;
  overflow: hidden;
}
.zhongyao_y1 {
  font-family: "Microsoft Yahei";
  color: #333;
  float: left;
  width: 65%;
  overflow: auto;
}
.zhongyao_c1 {
  float: right;
  width: 35%;
  overflow: hidden;
  text-align: right;
}
.demo-item1{
  width: 60%;
  overflow: hidden;
  text-overflow:ellipsis;
  white-space: nowrap
}
.zhongyao_c1 i {
  padding: 0.2rem;
  font-size: 0.9rem;
}
.input_number1 {
  border: none;
  width: 20%;
  text-align: center;
  font-family: "Microsoft Yahei";
  color: #333;
  background: #f1f1f1;
  border-radius: 0.4rem;
}
.input_n1 {
  border: none;
  border-bottom: 2px solid #f1f1f1;
  width: 16%;
  font-family: "Microsoft Yahei";
  color: #333;
  outline: none;
  height: 2rem;
  margin: 0 0.1rem;
  text-align: center;
  float: right;
}
.buttonRemove1 {
  padding: 0 0.2rem;
  border: none;
  float: right;
  background: #3190e8;
  color: #fff;
  border-radius: 0.2rem;
  margin-right: 0.2rem;
}
.zhongyao_c_footer1 {
  position: fixed;
  bottom: 0;
  text-align: left;
  width: 100%;
  background: #fff;
  z-index: 188;
}
.zhongyao_c_footer1 p{
  margin-bottom: 0;
}
.input_name1 {
  text-indent: .5rem;
  border: none;
  width: 80%;
  text-align: left;
  font-family: "Microsoft Yahei";
  color: #333;
  outline: none;
  padding:0.5rem 0;
  margin-bottom: 0.2rem;
  font-size: .9rem;
  /* border-bottom: 2px solid #f1f1f1; */
}
.input_tip1 {
  width: 100%;
  font-family: "Microsoft Yahei";
  color: #333;
  text-indent: 0.5rem;
  line-height: 2rem;
  border:none;
  outline: none;
}
.input_tip1:focus{
  background: #3190e84d;
}
.input_search_openpre1 {
  display: inline-block;
  line-height: 1;
  cursor: pointer;
  background: #3190e8;
  border: 1px solid #dcdfe6;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  font-weight: 500;
  padding: 0.6rem 2rem;
  border-radius: 4px;
  width: 20%;
  margin-top: 0.1rem;
}
.input_search1 {
  display: inline-block;
  line-height: 1;
  cursor: pointer;
  background: #3190e8;
  border: 1px solid #dcdfe6;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  font-weight: 500;
  padding: 0.6rem 2rem;
  border-radius: 4px;
  width: 100%;
  margin-top: 0.1rem;
}
.searchList1 {
  width: 100%;
  background: #fff;
  display: inline-block;
  overflow: auto;
  z-index: 100;
  height: 20rem;
  border-bottom: 1px solid #f1f1f1;
  text-indent: .5rem;
  padding-left: .3rem;
  padding-right: .3rem;
  border-radius: 10px;
  color: #000;
  -webkit-box-shadow: 0px -3px 10px #ccc;
  -moz-box-shadow: 0px -3px 10px #ccc;
  box-shadow: 0px -3px 10px #ccc;
  /*
  -webkit-transform: translate3d(5, -50%, 0);
  transform: translateY(0%); */
}
.searchList1 ul {
  margin-bottom: 0;
}
.searchList1 ul li {
  font-size: 0.9rem;
  height: 2rem;
  border-bottom: 1px solid #ccc;
  line-height: 2rem;
  text-align: left;
  width: 100%;
  overflow: hidden;
}
</style>
